﻿@using Abp.Collections.Extensions
@using Abp.Extensions
@model Abp.Web.Mvc.Models.ErrorViewModel
@{
    ViewBag.DisableTenantChange = true;

    var errorMessage = Model.ErrorInfo.Message;
    var errorDetails = Model.ErrorInfo.Details;
    if (errorDetails.IsNullOrEmpty())
    {
        errorDetails = errorMessage;
        errorMessage = L("Error");
    }
}

<head>
    <title>Duct - Error</title>

    <link href="~/view-resources/Views/Error/Index.css" rel="stylesheet" />
</head>
<div class="m-error_container">
    <span class="m-error_title">
        <h1>
            @errorMessage
        </h1>
    </span>
    <p class="m-error_subtitle">
        @errorDetails
    </p>
    <p class="m-error_description">
        @* Show validation errors *@
        @if (!Model.ErrorInfo.ValidationErrors.IsNullOrEmpty())
        {
            foreach (var validationError in Model.ErrorInfo.ValidationErrors)
                {
                <text>* </text>@(validationError.Message)
                if (validationError.Members != null && validationError.Members.Any())
                    {
                    <text>(@string.Join(", ", validationError.Members))</text>
                }
                <br/>
            }
        }
    </p>
</div>
